package com.rututor.server.jersey;


import java.util.logging.Logger;

import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;



import com.rututor.server.dao.SignUpEmailDAO;

@Path("/prelaunchemail")  
public class PreLaunchEmailService {
	private static final Logger Log  = Logger.getLogger(PreLaunchEmailService.class.getName()); //Need to set properties to use logging
	
	@POST
	@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
	
	public Response saveEmail (@FormParam("email") String email) {
		Log.fine(email);
		SignUpEmailDAO dao = new SignUpEmailDAO();
		dao.insertEmail(email);
		return Response.ok("success").build();
	}

}
